package org.at.strategy;

import org.at.enums.FullReductionStrategyTypeEnum;

import java.math.BigDecimal;

public class Full100Reduce10Strategy implements FullReductionStrategy {
    @Override
    public String getCode() {
        return FullReductionStrategyTypeEnum.Full100Reduce10.getCode();
    }

    @Override
    public BigDecimal calculateDiscountedTotalPrice(BigDecimal discountedTotal) {
        if (discountedTotal.compareTo(new BigDecimal("100")) >= 0) {
            return discountedTotal.subtract(new BigDecimal("10"));
        }
        return discountedTotal;
    }
}
